package com.yyfax.pay.depository.vo;

import com.yyfax.pay.common.enums.FuiouDepositStateEnum;
import com.yyfax.pay.common.exception.PayExceptionCode;
import com.yyfax.pay.depository.domain.FuiouChangePhone;

/**
 * 更换手机快照类
 * 
 * @author buyi
 * @date 2017-09-30 15:28:44
 * @since v2.0.0
 */
public class FuiouChangePhoneVO {
	private FuiouChangePhone po;

	/**
	 * 创建一个实例
	 * 
	 * @author buyi
	 * @date 2017-09-30 15:29:24
	 * @since v2.0.0
	 *
	 * @param po
	 * @return
	 */
	public static FuiouChangePhoneVO newInstance(FuiouChangePhone po) {
		if (po == null) {
			throw PayExceptionCode.ERROR_ILL_PARAMETER.expMsg("请求参数po不能为空");
		}

		return new FuiouChangePhoneVO(po);
	}

	private FuiouChangePhoneVO(FuiouChangePhone po) {
		super();
		this.po = po;
	}

	public FuiouChangePhone getPo() {
		return po;
	}

	public FuiouChangePhoneVO setPo(FuiouChangePhone po) {
		this.po = po;
		return this;
	}

	/**
	 * 判断是否已经出结果
	 * 
	 * @author buyi
	 * @date 2017-09-09 11:15:58
	 * @since v2.0.0
	 * @return
	 */
	public boolean isResult() {
		if (FuiouDepositStateEnum.SUCCESS.isValue(po.getState()) || FuiouDepositStateEnum.FAIL.isValue(po.getState())) {
			return true;
		}

		return false;
	}
}
